/**
 * Created by Administrator on 2017/9/22.
 */
define(['knockout', 'welcomeModule'], function (ko, wm) {
    var self = this;
    this.loginName = ko.observable();
    this.loginIdentity = ko.observable();
    this.initInfo = ko.observable();

    this.loadUserInfo = function () {
        wm.initUserInfo(self);
    };

    this.goback = function (root) {
        console.log(root);
        root.moduleOptions("login");
    };

    this.logout = function (root) {
        wm.removeUserInfo(root);
    };


    return {
        loginName: self.loginName,
        loginIdentity: self.loginIdentity,
        btnName: '返回',
        goback: self.goback,
        logoutBtn: '注销',
        logout: logout,
        initialize: loadUserInfo
    }
});